import * as service from "@/service";
import { IReel1, IReel2 } from "./interface";

const reel1: IReel1 = {
  namespaced: true,
  state: {
    states: [],
  },
  actions: {
    async getmon1({ commit }) {
      const res = await service.reel1();
      const action = {
        type: "GET_MON",
        res: res,
      };
      commit(action);
    },
  },
  mutations: {
    GET_MON(state, { res }) {
      state.states = res;
    },
  },
};
const reel2: IReel2 = {
  namespaced: true,
  state: {
    states: [],
  },
  actions: {
    async getmon2({ commit }, { params }) {
      console.log(params);

      const res = await service.mon2(params.categoryId);
      const action = {
        type: "GET_MON",
        res: res,
      };
      commit(action);
    },
  },
  mutations: {
    GET_MON(state, { res }) {
      state.states = res;
    },
  },
};
export { reel1, reel2 };
